﻿Imports System.Data
Imports VSModel
Imports Cls_Common

Partial Class Control_MSDS_Section09View
    Inherits System.Web.UI.UserControl
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            hidMSDSID.Value = IIf(IsNothing(Request.QueryString("Id")), 0, CInt(Request.QueryString("Id")))
            ShowData()
        End If
    End Sub
    Protected Sub Translate()
        lblSection09Header.Text = getTranslate("lblSection09Header", Session("LanguageId"), lblSection09Header.Text)
        lblS911.Text = getTranslate("lblS911", Session("LanguageId"), lblS911.Text)
        lblS921.Text = getTranslate("lblS921", Session("LanguageId"), lblS921.Text)
        lblS931.Text = getTranslate("lblS931", Session("LanguageId"), lblS931.Text)
        lblS941.Text = getTranslate("lblS941", Session("LanguageId"), lblS941.Text)
        lblS951.Text = getTranslate("lblS951", Session("LanguageId"), lblS951.Text)
        lblS961.Text = getTranslate("lblS961", Session("LanguageId"), lblS961.Text)
        lblS971.Text = getTranslate("lblS971", Session("LanguageId"), lblS971.Text)
        lblS981.Text = getTranslate("lblS981", Session("LanguageId"), lblS981.Text)

        lblS991.Text = getTranslate("lblS991", Session("LanguageId"), lblS991.Text)
        lblS9101.Text = getTranslate("lblS9101", Session("LanguageId"), lblS9101.Text)
        lblS9111.Text = getTranslate("lblS9111", Session("LanguageId"), lblS9111.Text)
        lblS9121.Text = getTranslate("lblS9121", Session("LanguageId"), lblS9121.Text)
        lblS9131.Text = getTranslate("lblS9131", Session("LanguageId"), lblS9131.Text)
        lblS9141.Text = getTranslate("lblS9141", Session("LanguageId"), lblS9141.Text)
        lblS9151.Text = getTranslate("lblS9151", Session("LanguageId"), lblS9151.Text)
        lblS9161.Text = getTranslate("lblS9161", Session("LanguageId"), lblS9161.Text)
    End Sub
    Protected Sub ShowData()
        Using data As New VSEntities
            'Tiêu đề doanh nghiệp
            Dim lang = CInt(Session("LanguageId"))
            Dim Id As Integer = hidMSDSID.Value
            Dim p As MSDSSection09 = (From a In data.MSDSSection09 Where a.MSDSId = Id And a.LanguageId = lang).SingleOrDefault
            If Not IsNothing(p) Then
                hidID.Value = p.Section09Id

                'Content
                lblViewS911.Text = IIf(IsNothing(p.S911) = True, "", p.S911)
                lblViewS921.Text = IIf(IsNothing(p.S921) = True, "", p.S921)
                lblViewS931.Text = IIf(IsNothing(p.S931) = True, "", p.S931)
                lblViewS941.Text = IIf(IsNothing(p.S941) = True, "", p.S941)
                lblViewS951.Text = IIf(IsNothing(p.S951) = True, "", p.S951)
                lblViewS961.Text = IIf(IsNothing(p.S961) = True, "", p.S961)
                lblViewS971.Text = IIf(IsNothing(p.S971) = True, "", p.S971)
                lblViewS981.Text = IIf(IsNothing(p.S981) = True, "", p.S981)
                lblViewS991.Text = IIf(IsNothing(p.S991) = True, "", p.S991)
                lblViewS9101.Text = IIf(IsNothing(p.S9101) = True, "", p.S9101)
                lblViewS9111.Text = IIf(IsNothing(p.S9111) = True, "", p.S9111)
                lblViewS9121.Text = IIf(IsNothing(p.S9121) = True, "", p.S9121)
                lblViewS9131.Text = IIf(IsNothing(p.S9131) = True, "", p.S9131)
                lblViewS9141.Text = IIf(IsNothing(p.S9141) = True, "", p.S9141)
                lblViewS9151.Text = IIf(IsNothing(p.S9151) = True, "", p.S9151)
                lblViewS9161.Text = IIf(IsNothing(p.S9161) = True, "", p.S9161)
            End If
            'Label
            Translate()
        End Using
    End Sub

End Class
